
<div class="right_title"> <span>
  <?=isset($_SESSION['gids'])?count($_SESSION['gids']):0;?>
  <?=NAME_PRODUCT;?>
  </span> </div>
<div class="content">
  <table id="Table_01" width="100%"  border="0" cellpadding="0" cellspacing="0" class="ListCart" align="center">
    <!--DWLayoutTable-->
    <tr>
      <td width="100%" valign="top"><form action="index.php?do=cart&amp;act=update&amp;lg=<?=$lg?>" method="post" name="f" id="f" onsubmit="return CheckForm()">
          <table cellpadding="3" cellspacing="0" border="0" width="100%" align="center" class="menu_cap2" id="cart">
            <tr>
              <td width="5%" class="table_title" align="left"><?php echo DEL; ?></td>
              <td width="5%" align="center" class="table_title"><?php echo NO; ?></td>
              <td width="20%" class="table_title" align="left">&nbsp;</td>
              <td width="20%" class="table_title" align="center"><?php echo NAME_PRODUCT; ?></td>
              <td width="15%" align="center" class="table_title"><?php echo QUANTITY; ?></td>
              <td width="15%" align="right" class="table_title"><?php echo PRICE; ?></td>
              <td width="20%" align="right" class="table_title"><?php echo MONEY; ?></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center" class="text"><hr size="1" style="border-top: 1px solid #F2D8DD;"/></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="15"></td>
            </tr>
            <?
											$c=0;
											$gids=isset($_SESSION['gids'])?$_SESSION['gids']:'';	
											if ($gids){
												for ($j=0; $j<count($gids); $j++) 
												if ($gids[$j]) $c++;
											}
											if (($gids)&&($c>0 )) {
											
												global $db;
												$gids = $_SESSION['gids'];
												
												$counts = $_SESSION['counts'];
												$total=0;
												$sl = 0;
												$k=0;
												print('<input type="hidden" name="SoLuongHang" value="'.count($gids).'" />');
												global $tieptuc;
												for ($i=0; $i<count($gids); $i++)
													{  
														if ($gids[$i]!=0) {
															$pId = $gids[$i];
															$pos = strpos($pId, "_img");
															if( $pos> 0 ){
																$pId = substr($pId, 0, $pos);
																$q="select id, name_" . $_SESSION['lg'] . " as name, price, cid, img from products where id=".$pId;
															}
															else{
																$q="select id, name_" . $_SESSION['lg'] . " as name, price, cid, img from products where id=".$pId;
															}
															$r = $db->getRow($q);
														if($i == (count($gids)-1)){
															$tieptuc=$r['cid'];
														}
														$k++;
														$gia = number_format($counts[$i])*$r['price'];
														$total+=$gia;
														$qa = number_format($counts[$i]);
														$sl+=$qa;
											?>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="10"></td>
            </tr>
            <tr valign="top">
              <td class="title" align="left" valign="middle"><input type="checkbox" name="remove[]" value="<?=$r['id']?>" id="remove<?=$i?>" />
                <input type="hidden" value="<?=$r['id']?>" name="item[]" /></td>
              <td align="center" class="title" valign="middle"><?=$k?></td>
              <? $img = GetImage($r['img']); ?>
              <td class="title" valign="middle"><img src="<?=$img;?>" width="96" height="96" alt="" /></td>
              <td class="title" valign="middle"><?=$r['name']?></td>
              <td align="center" class="title" valign="middle"><input type="text" name="qt[]" id="<?='qtt'.$i?>"  style="width:30px; text-align:center;" value="<?=$counts[$i]?>" onkeypress="return OnlyNumber(event)"/></td>
              <td align="right" class="title" valign="middle"><?=number_format($r['price'])?>
                <?=CST_CURRENCY_CODE;?></td>
              <td align="right" class="title" valign="middle"><strong style="color:#FF0000; font-style:italic;">
                <?=number_format($gia);?>
                <?=CST_CURRENCY_CODE;?>
                </strong></td>
            </tr>
            <? if($i != (count($gids)-1)) { ?>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="10"></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center" class="text"><hr size="1" style="border-top: 1px solid #F2D8DD;"/></td>
            </tr>
            <? } } } ?>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="10"></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center"><hr size="1" style="border-top: 1px solid #F2D8DD;"/></td>
            </tr>
            <tr>
              <td colspan="6" class="total_cost" align="right"><?php echo TOTAL; ?>:</td>
              <td class="center" align="right">&nbsp;&nbsp;<strong style="color:#FF0000">
                <?=number_format($total)?>
                <?
                	//$_SESSION['cost'] = number_format($total);
					//$_SESSION['code'] = 1;
				?>
                <?=CST_CURRENCY_CODE;?>
                </strong></td>
            </tr>
            <tr>
              <td class="b3" colspan="7" align="right"><br />
                <input type="submit" value="<?php echo UPDATE; ?>" name="submit" class="button" />
                <input type="button" value="<?php echo CONTINUEXX; ?>" onclick="window.location.href='<?=isset($_SESSION['CONTINUE_SHOPPING_URL'])?$_SESSION['CONTINUE_SHOPPING_URL']:'index.php'?>';" name="button" class="button" />
                
                <!--<input type="button" value="<?php echo ORDER; ?>" onclick="window.location.href='index.php?do=cart&amp;act=checkout&amp;lg=<?=$lg?>'" name="button" class="button" />--></td>
            </tr>
            <? } else { ?>
            <tr valign="top">
              <td align="center" class="text">&nbsp;</td>
              <td colspan="6" align="center" valign="middle" class="text"><b><?php echo DESC_CART; ?></b></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="15"></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center"><hr size="1" style="border-top: 1px solid #F2D8DD;"/></td>
            </tr>
            <tr valign="top">
              <td colspan="7" align="center" class="text" height="10"></td>
            </tr>
            <tr valign="top">
              <td colspan="7" valign="middle" align="center"><input type="button" value="<?php echo BACK; ?>" onclick="window.location.href='<?=isset($_SESSION['CONTINUE_SHOPPING_URL'])?$_SESSION['CONTINUE_SHOPPING_URL']:'index.php'?>';" name="button" class="button" /></td>
            </tr>
            <? } ?>
          </table>
        </form></td>
    </tr>
    <tr>
      <td height="23" valign="top">&nbsp;</td>
    </tr>
  </table>
  
  
  <? if(isset($_SESSION['member_login']) && $_SESSION['member_login'] == 1) {?>
  <div class="centerColumn" id="contactUsDefault">
  <form action="<?php echo $FullUrl; ?>/index.php?do=cart&act=ordersm&lg=<?=$_SESSION['lg']?>" class="FormNhaSanXuat" method="post" name="formcontact" id="formcontact" onsubmit="return Register();">
    <fieldset id="contactUsForm">
    	<br/>
        <?=PAYMENT_INFO?>
        <br/>
    	<label class="inputLabel" for="contactname"><?=LABEL_NAME?>:</label>
        <input name="HoTenInput" size="40" id="namex" type="text" value="<?=isset($_SESSION['member_name'])?$_SESSION['member_name']:''?>">
        <span class="alert">*</span><br class="clearBoth">        
        
        <label class="inputLabel" for="contactname"><?=LABEL_ADDRESS?>:</label>
        <input name="DiaChiInput" size="40" id="diachi" type="text" value="<?=isset($_SESSION['member_address'])?$_SESSION['member_address']:''?>">
        <span class="alert">*</span><br class="clearBoth"> 
        
        <label class="inputLabel" for="contactname"><?=LABEL_PHONE?>:</label>
        <input name="DienThoaiInput" size="40" id="dienthoai" type="text" value="<?=isset($_SESSION['member_phone'])?$_SESSION['member_phone']:''?>">
        <span class="alert">*</span><br class="clearBoth">  
        
        <label class="inputLabel" for="contactname"><?=LABEL_EMAIL?>:</label>
        <input name="EmailInput" size="40" id="emailx" type="text" alue="<?=isset($_SESSION['member_email'])?$_SESSION['member_email']:''?>">
        <span class="alert">*</span><br class="clearBoth">
        
        <label class="inputLabel" for="contactname"><?=COMPANY?>:</label>
        <input name="CongTyInput" size="40" id="congty" type="text" alue="<?=isset($_SESSION['member_email'])?$_SESSION['member_email']:''?>">
        <span class="alert">*</span><br class="clearBoth">        
        
        <br/>
        <label for="enquiry"><?=NOTE?>:<span class="alert">*</span></label>
        <textarea name="TinNhanInput" cols="30" rows="7" id="noidung"></textarea>
        <br/>      
        <br/>
        <?=SHIPPING_INFO?>
        <br/>
        <label class="inputLabel" for="contactname"><?=LABEL_NAME?>:</label>
        <input name="receive_HoTenInput" size="40" id="receive_namex" type="text" value="<?=isset($_SESSION['member_name'])?$_SESSION['member_name']:''?>">
        <span class="alert">*</span><br class="clearBoth">        
        
        <label class="inputLabel" for="contactname"><?=LABEL_ADDRESS?>:</label>
        <input name="receive_DiaChiInput" size="40" id="receive_diachi" type="text" value="<?=isset($_SESSION['member_address'])?$_SESSION['member_address']:''?>">
        <span class="alert">*</span><br class="clearBoth"> 
        
        <label class="inputLabel" for="contactname"><?=LABEL_PHONE?>:</label>
        <input name="receive_DienThoaiInput" size="40" id="receive_dienthoai" type="text" value="<?=isset($_SESSION['member_phone'])?$_SESSION['member_phone']:''?>">
        <span class="alert">*</span><br class="clearBoth">  
        
        <label class="inputLabel" for="contactname"><?=LABEL_EMAIL?>:</label>
        <input name="receive_EmailInput" size="40" id="receive_emailx" type="text" alue="<?=isset($_SESSION['member_email'])?$_SESSION['member_email']:''?>">
        <span class="alert">*</span><br class="clearBoth">
        
        <label class="inputLabel" for="contactname"><?=COMPANY?>:</label>
        <input name="receive_CongTyInput" size="40" id="receive_congty" type="text" alue="<?=isset($_SESSION['member_email'])?$_SESSION['member_email']:''?>">
        <span class="alert">*</span><br class="clearBoth">        
        
        <br/>
      <div class="FooterForm">
        <input type="button" onclick="return Register()" value="<?php echo SEND; ?>" class="button" />
        <input type="reset" value="<?php echo RESET; ?>" class="button" />
      </div>
      
    </fieldset>
  </form>
</div>
<? } ?>
<!--đã đăng nhập--> 
<!--chưa đăng nhập-->
<? if(!isset($_SESSION['member_login'])) 
    {?>
<div class="centerColumn" id="contactUsDefault">
  
  <form action="<?php echo $FullUrl ?>/index.php?do=member&amp;act=login&amp;lg=<?=$lg?>&amp;page=checkout" class="FormNhaSanXuat" method="post" name="formcontact" id="formcontact">
  	<fieldset id="contactUsForm">
    	<label class="inputLabel" for="email-address"><?= EMAIL ?>:</label>
        <input name="email" size="40" id="email" type="text">
        <span class="alert">*</span><br class="clearBoth">
        
    	<label class="inputLabel" for="email-address"><?= PASSWORD ?>:</label>
        <input name="password" size="40" id="password" type="password">
        <span class="alert">*</span><br class="clearBoth">     
      <?
            if(isset($_SESSION['counter_login']))
            {
                if($_SESSION['counter_login'] != NULL && $_SESSION['counter_login'] > 1)
                { ?>
      <br/>
      <center>
        <img src="<?php echo $FullUrl; ?>/CaptchaSecurityImages.php?width=100&amp;height=40&amp;characters=6" />
      </center>
      <p class="security">
        <input name="security_code" type="text" id="security_code">
      </p>
      <?	}
            }?>
      <div class="FooterForm">
        <input class="button" type="submit" value="<?= SIGN_IN ?>" />
        <label for="QuenPass"><a class="forgot_pass" href="<?=$FullUrl. $prefix_url?>forgot-password.html">
          <?= FORGOT_PASS ?>
          </a></label>
      </div>
    </div>
    </fieldset>
  </form>
</div>
<? } ?>
<!--chưa đăng nhập--> 

<!--End Add-->
</div>
